
import { http } from '@/http/http'
import { ContentTypeEnum } from '@/http/tools/enum'

// 试卷列表（专项测试和茶叶测试列表）
export function paperList(query) {
  return http.get(
    '/user/exam/paperList', 
    query,
    // {
    //   'Content-Type': ContentTypeEnum.FORM_URLENCODED
    // }
  )
} 


// 试卷信息（开始考试界面使用）
export function paperInfo(query) {
  return http.get(
    '/user/exam/paperInfo', 
    query,
  )
}

// 试卷详情
export function paperDetail(query) {
  return http.get(
    '/user/exam/paperDetail', 
    query,
  )
}

// 每日10题详情
export function everyday10() {
  return http.get(
    '/user/exam/everyday10', 
    undefined,
  )
}

// 回答问题(判断题和单选题首次提交答案和后续修改答案均使用该接口；多选首次提交选项使用该接口，后续修改答案应使用取消答案接口后再提交新的选项，每次仅可操作单个选项；)
export function answerQuestion(data) {
  return http.post(
    '/user/exam/answerQuestion', 
    data,
    undefined,
    {
      'Content-Type': ContentTypeEnum.FORM_URLENCODED
    }
  )
}


// 取消答案(多选取消已经选择的选项时使用该接口，该接口是单项操作，每次只能取消一个选项；)
export function cancelAnswer(data) {
  return http.post(
    '/user/exam/cancelAnswer', 
    data,
    undefined,
    {
      'Content-Type': ContentTypeEnum.FORM_URLENCODED
    }
  )
}

// 提交考试
export function submitPaper(data) {
  return http.post(
    '/user/exam/submitPaper', 
    data,
    undefined,
    {
      'Content-Type': ContentTypeEnum.FORM_URLENCODED
    }
  )
}


// 错题复习
export function wrongReview(query) {
  return http.get(
    '/user/exam/wrongReview', 
    query,
  )
}

// 错题练习
export function wrongExercise(query) {
  return http.get(
    '/user/exam/wrongExercise', 
    query,
  )
}
// 考试记录
export function recorddList(query) {
  return http.get(
    '/user/exam/recorddList', 
    query,
  )
}
// 记录详情
export function recordDetail(query) {
  return http.get(
    '/user/exam/recordDetail', 
    query,
  )
}